<template>
    <div>
            活动标题<input type="text" v-model="pages.Hname">
            分类<select v-model="pages.Hlxid">
                <option v-for="d in xl" :value="d.Fid">{{d.Fname}}</option>
            </select>
            <input type="button" value="查询" @click="xianshi">
            <table class="table">
                 <thead>
                      <tr>
                          <td>图片</td>
                          <td>活动信息</td>
                          <td>活动状态</td>
                          <td>分类</td>
                          <td>活动时间</td>
                          <td>活动地点</td>
                          <td>最后更新人</td>
                          <td>最后更新时间</td>
                          <td></td>
                      </tr>
                 </thead>
                 <tbody>
                       <tr v-for="d in data">
                          <td><img :src="'https://localhost:7059/' + d.Htp" style="width: 60px; height: 60px;" ></td>
                          <td>{{d.Hname}}</td>
                          <td>{{d.Hzt}}</td>
                          <td>{{d.Fname}}</td>
                          <td>{{d.Hrq}}</td>
                          <td>{{d.Hdd}}</td>
                          <td>{{d.Hgxr}}</td>
                          <td>{{d.Hgxsj}}</td>
                          <td>
                               <input type="button" value="修改" @click="xg(d.Hid)">
                          </td>
                      </tr>
                 </tbody>
            </table>

          
    </div>
</template>

<script setup lang="ts">
import axios from 'axios'
import {ref,onMounted, pushScopeId} from 'vue'
import {useRouter} from 'vue-router'

const router = useRouter()

const xg=(Hid:any)=>{
   router.push({path:"/xiugai/",query:{Hid:Hid}})
}

const data = ref([{
    "Hid": 0,
    "Htp": "string",
    "Hname": "",
    "Hzt": "",
    "Hlxid": 0,
    "Hrq": "2025-07-13T00:00:00",
    "Hdd": "",
    "Hgxr": "",
    "Hgxsj": "2025-7-14",
    "Fid": 0,
    "Fname": ""
}])

const pages = ref({
    "Hname":"",
    "Hlxid":0
})



const xianshi=()=>{
    axios.get("https://localhost:7059/api/HD/Show",{params:pages.value}).then(res=>{
        data.value = res.data

    })
}



onMounted(()=>{
  Bang()
  xianshi()
})

const xl = ref([{
     "Fid": 1,
    "Fname": "文化娱乐"
}])

const Bang=()=>{
    axios.get("https://localhost:7059/api/HD/Bang").then(res=>{
        xl.value = res.data
    })
}
</script>

<style scoped>

</style>